﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var Uid = txtUserName.Text ;
            var Pwd = txtPassWord.Text  ;
            var RePwd = txtRetryPassWord.Text ;

            var hasUid = !string.IsNullOrEmpty(Uid );
            var hasPwd = !string.IsNullOrEmpty(Pwd);
            var eqPwd = Pwd == RePwd;

            if (hasUid && hasPwd && eqPwd)
            {
                MessageBox.Show("注册成功！");

                Form1.users.Add(Uid, Pwd);
                this.Close(); 
            }
            else
            {
                MessageBox.Show("注册失败！");

            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            MessageBox.Show("取消！");
            this.Close();
        }
    }
}
